package com.xbongbong.pro.statistic.pojo;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.io.Serializable;

/**
 * 累加器，记录每种类型字段的位置
 * @author 梁鲁江
 * @version v1.0
 * @date 2020/3/31 14:38
 * @since v1.0
 */
@Getter
@Setter
@ToString
public class AccumulatorPojo implements Serializable {
    private static final long serialVersionUID = -8735392369499898586L;
    /**
     *文本字段
     */
    private Integer text;
    /**
     * 数字字段
     */
    private  Integer num;
    /**
     * 
     */
    private  Integer longN;
    /**
     * 存放原来的address和geo,二者没有差别，地址字段也可以添加定位
     */
    private  Integer location;
    /**
     * 日期字段
     */
    private  Integer date;
    /**
     * 子表单
     */
    private  Integer subForm;
    /**
     * 团队
     */
    private  Integer myTeam;
    /**
     * 文件地址，不分词
     */
    private  Integer file;
    /**
     * 数组类型
     */
    private  Integer array;
    /**************************以下属于data外字段，需要特殊处理***************************************/
    /**
     * 表单id
     */
    private Integer formId;
    /**
     * 编号
     */
    private Integer serialNo;
    /**
     * 拥有者id
     */
    private Integer ownerId;
    /**
     * 协同人id
     */
    private Integer coUserId;
    /**
     * 部门id
     */
    private Integer departmentId;
    /**
     * 流程状态枚举值
     */
    private Integer flowStatus;
    /**
     * 创建者id
     */
    private Integer creatorId;

    private Integer dataId;
    
    private Integer id;
    
    private Integer otherId;



    public AccumulatorPojo() {
        this.text = 0;
        this.num = 0;
        this.longN = 0;
        this.location = 0;
        this.date = 0;
        this.subForm = 0;
        this.myTeam = 0;
        this.file = 0;
        this.array = 0;
        this.formId = 0;
        this.serialNo = 0;
        this.ownerId = 0;
        this.coUserId = 0;
        this.departmentId = 0;
        this.flowStatus = 0;
        this.creatorId = 0;
        this.dataId = 0;
        this.id = 0;
        this.otherId = 0;
    }

    public Integer getTextAccum() {
        //TODO 这里要去判断MAX值  如果超出了
        setText(text + 1);
        return text;
    }

    public Integer getNumAccum() {
        setNum(num + 1);
        return num;
    }

    public Integer getLocationAccum() {
        setLocation(location + 1);
        return location;
    }

    public Integer getDateAccum() {
        setDate(date + 1);
        return date;
    }

    public Integer getSubFormAccum() {
        setSubForm(subForm + 1);
        return subForm;
    }

    public Integer getMyTeamAccum() {
        setMyTeam(myTeam + 1);
        return myTeam;
    }

    public Integer getFileAccum() {
        setFile(file + 1);
        return file;
    }

    public Integer getArrayAccum() {
        setArray(array + 1);
        return array;
    }

    public Integer getFormIdAccum() {
        setFormId(formId + 1);
        return formId;
    }

    public Integer getOwnerIdAccum() {
        setOwnerId(ownerId + 1);
        return ownerId;
    }

    public Integer getCoUserIdAccum() {
        setCoUserId(coUserId + 1);
        return coUserId;
    }

    public Integer getDepartmentIdAccum() {
        setDepartmentId(departmentId + 1);
        return departmentId;
    }

    public Integer getFlowStatusAccum() {
        setFlowStatus(flowStatus + 1);
        return flowStatus;
    }

    public Integer getCreatorIdAccum() {
        setCreatorId(creatorId + 1);
        return creatorId;
    }
    public Integer getDataIdAccum() {
        setDataId(dataId + 1);
        return dataId;
    }
    public Integer getIdAccum() {
        setId(id + 1);
        return id;
    }

    public Integer getLongNum() {
        setLongN(longN + 1);
        return longN;
    }
    public Integer getOtherIdNum() {
        setOtherId(otherId + 1);
        return otherId;
    }
}
